﻿using System.Collections.Generic;
using Kent.Boogaart.KBCsv;
using TestBat.IInfrastructure.CSV;

namespace TestBat.Infrastructure.CSV
{
    public class CSVWriter : ICSVWriter
    {
        public CSVWriter()
        {
        }

        public void Write(string path, string[] headerRecords, ICollection<string[]> dataRecords)
        {
            CsvWriter writer = new CsvWriter(path);
            writer.AlwaysDelimit = true;
            writer.ValueSeparator = ';';
            writer.WriteHeaderRecord(headerRecords);
            writer.WriteDataRecords(dataRecords);
            writer.Close();
        }
    }
}
